﻿@using KPIS.GERP.Models.ICM
@model IEnumerable<KPIS.GERP.Models.ICM.Warehouse>

@{
    ViewBag.Title = "ข้อมูลพื้นฐาน";
    ViewBag.Descr = "คลังพัสดุ";
}
<div class="row-fluid">
    <div class="block-button-menu-above">
       <a href="Index"> @Html.ButtonViewAll()</a>
       <a href="Add"> @Html.ButtonAdd()</a>
       <a href="#"> @Html.ButtonDeleteAll()</a>
    </div>
    <table id="table" class="table table-striped table-bordered table-hover" aria-describedby="table_info">
        <thead>
            <tr>
                <th class="center" style="width:50px;">
                    <label>
                        <input type="checkbox" />
                        <span class="lbl"></span>
                    </label>
                </th>
                <th>
                 ชื่อหน่วยงาน
                </th>
            </tr>
        </thead>

        <tbody>
         @*@foreach(var m in Model)
            {
                *@<tr>
                    <td class="center">
                        <label>
                            <input type="checkbox" />
                            <span class="lbl"></span>
                        </label>
                    </td>
                    <td>#</td>
                </tr>
           @* }*@
       </tbody>
    </table>
</div>



@section scripts {
    
	<script type="text/javascript">
	    $(function () {
	        var oTable1 = $('#table').dataTable({
	            "aoColumns": [
                    { "bSortable": false },
                    null,
                    null,
                    { "bSortable": false }
	            ]
	        });

	        $('table th input:checkbox').on('click', function () {
	            var that = this;
	            $(this).closest('table').find('tr > td:first-child input:checkbox')
				.each(function () {
				    this.checked = that.checked;
				    $(this).closest('tr').toggleClass('selected');
				});

	        });

	        $('[data-rel=tooltip]').tooltip();
	    })

	</script>
}